DoList gives you the ability to handle a scrolling list of text strings, allowing a user to select one or more items from a long list.
DoList can be used in three different modes:
Mode 1: Uses a dialog resource for the list. This requires 2 additional resources in the stack, 1 'DLOG' and its 'DITL' resource.
•<Resource ID> is the ID of the 'DLOG' resource in the stack.
•Item 1 must be a button item, and is used for the Select button. It can have any position and rectangle, and is not reset.
•Item 2 must be a button item, and is used for the Cancel button. It can have any position and rectangle, and is not reset.
•Item 3 must be a useritem, and is used for the list window. It must have the rectangle and position you wish to use for the list.
•Item 4 must be a useritem, and is used for outlining the Select button. It can have any rectangle, since its rect will be set for you.
Make sure that the vertical size of useritem 3 (the list window) is a multiple of 15. This insures that it will have the proper appearance.
Make sure the visible bit of the dialog resource is false. If the dialog is initially visible, its appearance while it is being drawn to the screen is not as clean and professional-looking.
Mode 2: Requires NO additional resources at all. This is the simplest and most common mode. The list box will always appear in the center of the HyperCard window, and will always have the same orientation.
Mode 3: Same as mode 2, but the list box position can be anywhere on the HyperCard window. The size and orientation of the box are not changed, only its location on the window.
All commercial distribution rights reserved. The XCMD resources and information in this stack may be freely used and distributed for any purpose except direct sale of the DoList XCMD. No guarantees are given as to the performance of this software, and the author is not liable for any losses incured by any user.
If you use DoList in one of your stacks for distribution, please include my name in your about box. This type of credit is my only compensation, and is a motivating factor for releasing routines such as these free of charge.
<List> is the actual list of items separated by commas.
<Flag> is 1 of 3 possible values, and determines list characteristics.
<H> is the horizontal coordinate for the list box in local coordinates.
<V> is the vertical coordinate for the list box in local coordinates.
Flag Setting:
The <Flag> parameter is passed in every mode, and determines how many items the user can select, and affects how they are selected. It should be one of the following:
ONE Will allow the user to select only 1 item from the list.
CON Will allow the user to select 1 or more items from the list, with the items being continous.
DIS Will allow the user to select 1 or more items from the list, in any order, not necessarily continous.
The Result:
If it is empty, then the user clicked on the Cancel button. Otherwise, item 1 of it will be the number of items selected. Item 2 will be the list of items selected.